package bg.btanev.eightyfour.shared.analytics;

import java.util.Date;

/**
 *
 * @author B.Tanev
 *
 */
public class DayActivityStat extends CountingStat {
	/**
	 *
	 */
	private static final long serialVersionUID = 8717669713407455339L;

	private Date date;

	protected DayActivityStat() {
		super();
	}

	protected DayActivityStat(Date day, long total) {
		super(total);

		this.date = day;
	}

	public Date getDay() {
		return date;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		DayActivityStat other = (DayActivityStat) obj;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "DayActivityStat [date=" + date + ", toString()=" + super.toString() + "]";
	}
}
